package com.example.growthmuseum.service;

import com.example.growthmuseum.data.model.Goods;
import com.example.growthmuseum.data.model.Result;

import java.util.List;

import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import rx.Observable;

/**
 * Created by Roman on 2016/10/29.
 */
public interface GoodsService {
    @GET("goods/getGoodsById/{id}")
    Observable<Result<Goods>> getGoodsDesc(@Path("id") Integer id);

    @GET("goods/getGoodsListByUserId/{page}/{rows}/{userId}")
    Observable<Result<List<Goods>>> getGoodsListByUserId(@Path("page") Integer page,
                                                         @Path("rows") Integer rows,
                                                         @Path("userId") Integer userId);

    @PUT("goods/updateGoods")
    Observable<Result<Integer>> updateGoods(@Body Goods goods);

    @POST("goods/addGoods")
    Observable<Result<Integer>> addGoods(@Body Goods goods);

    @GET("goods/getGoodsList")
    Observable<Result<List<Goods>>> getGoodsList();
}
